package com.qjc.controller;

import com.qjc.entity.Result;
import com.qjc.exception.CommonException;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @description: 字典controller
 * @author: Kevin
 * @date: 2021/8/24 14:03
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/{version}/test")
public class TestController {

    /**
     * 访问地址：http://127.0.0.1:8080/api/v1/test/test?type=1
     * 请求头新增：languageKey=ru
     */
    @GetMapping("/test")
    public Result<String> dictionary(Integer type) {
        if (type == 1) {
            throw new CommonException("7100001", "测试国际化提示");
        }
        return Result.success();
    }

}
